<?php

namespace Desktopd\MUA;


// ReceivedMessage (Raw MIME)
class ReceivedMessage extends Message {
    protected $header;
    protected $body;
    
    public function __construct ($header = '', $body = '') {
        $this->importRaw($header . $body);
    }
    
    /**
        @returns NewMessage
    */
    public function createNewMessage () {
        //throw new \RuntimeException('Not implemented yet');
        
        $data = $this->exportRaw();
        $new = new NewMessage();
        $new->importRaw($data);
        $new->removeHeader('Return-path');
        $new->removeHeader('X-Original-To');
        
        return $new;
    }
}


// vim: ts=4 et ai

